import DialogBaseUI from "../custom/DialogBaseUI";

const {ccclass, property} = cc._decorator;
@ccclass
export default class NoticeUI extends DialogBaseUI {

    @property(cc.Node)
    detailNode = null;
    @property(cc.Node)
    abstractNode = null;
    onLoad(){
        this.abstractNode.active = true;
        this.detailNode.active = false;
    }
    onClickItem(e,data){
        this.abstractNode.active = false;
        this.detailNode.active = true;
        let name = "bg_notice_details_" + data;
        let children = this.detailNode.children;
        for(let i=0;i<children.length;i++){
            if(children[i].name == name || children[i].name == "btn_confirm" ){
                children[i].active = true;
            }else{
                children[i].active = false;
            }
        }
    }

    onClickConfirm(){
        this.abstractNode.active = true;
        this.detailNode.active = false;
    }
}